Load Data

dataset <- read.delim("raw_data/Figure1E.txt", stringsAsFactors = FALSE)

dataset$genotype <- gsub("\\+$","",gsub(" |mCherry","",dataset$genotype))
dataset$genotype <-  factor(dataset$genotype, levels = unique(dataset$genotype))
dataset$Experiment <- factor(rep(paste0("exp", 1:(length(dataset$genotype)/length(levels(dataset$genotype)))), each=length(levels(dataset$genotype))))

# genotype+Experiment gives unique ID (UID)
dataset$UID <- factor(paste(dataset$Experiment, dataset$genotype))


# wide format
kable(dataset, row.names = F)
genotype NT olaparib_30nM olaparib_300nM olaparib_3000nM Experiment UID
WT 733.0 748.5 726.0 549.0 exp1 exp1 WT
ALC1KO 926.5 737.0 470.0 227.5 exp1 exp1 ALC1KO
ALC1KO+ALC1WT 541.5 568.0 468.5 132.0 exp1 exp1 ALC1KO+ALC1WT
ALC1KO+ALC1G750E 777.0 690.5 370.5 67.0 exp1 exp1 ALC1KO+ALC1G750E
ALC1KO+ALC1E175Q 320.5 243.5 112.0 5.0 exp1 exp1 ALC1KO+ALC1E175Q
ALC1KO+ALC1K77R 637.5 574.0 304.5 45.5 exp1 exp1 ALC1KO+ALC1K77R
WT 842.5 800.0 856.0 710.0 exp2 exp2 WT
ALC1KO 634.0 430.5 270.0 58.5 exp2 exp2 ALC1KO
ALC1KO+ALC1WT 443.0 405.0 353.5 123.0 exp2 exp2 ALC1KO+ALC1WT
ALC1KO+ALC1G750E 700.0 476.0 418.0 106.0 exp2 exp2 ALC1KO+ALC1G750E
ALC1KO+ALC1E175Q 467.5 379.0 190.5 35.0 exp2 exp2 ALC1KO+ALC1E175Q
ALC1KO+ALC1K77R 362.5 247.5 138.0 22.5 exp2 exp2 ALC1KO+ALC1K77R
WT 786.5 775.0 734.0 686.0 exp3 exp3 WT
ALC1KO 777.5 600.5 343.5 56.0 exp3 exp3 ALC1KO
ALC1KO+ALC1WT 759.5 661.5 693.5 254.0 exp3 exp3 ALC1KO+ALC1WT
ALC1KO+ALC1G750E 823.5 807.0 608.0 111.0 exp3 exp3 ALC1KO+ALC1G750E
ALC1KO+ALC1E175Q 401.0 250.5 148.0 27.5 exp3 exp3 ALC1KO+ALC1E175Q
ALC1KO+ALC1K77R 695.0 614.0 422.5 86.0 exp3 exp3 ALC1KO+ALC1K77R
WT 845.5 780.5 814.0 588.5 exp4 exp4 WT
ALC1KO 802.5 659.5 369.0 52.0 exp4 exp4 ALC1KO
ALC1KO+ALC1WT 799.0 796.0 759.5 411.5 exp4 exp4 ALC1KO+ALC1WT
ALC1KO+ALC1G750E 971.5 935.5 779.0 217.0 exp4 exp4 ALC1KO+ALC1G750E
ALC1KO+ALC1E175Q 672.5 443.0 262.0 41.5 exp4 exp4 ALC1KO+ALC1E175Q
ALC1KO+ALC1K77R 646.0 578.0 468.5 73.5 exp4 exp4 ALC1KO+ALC1K77R
WT 853.0 854.0 847.0 643.5 exp5 exp5 WT
ALC1KO 508.0 468.5 208.0 26.5 exp5 exp5 ALC1KO
ALC1KO+ALC1WT 427.0 401.5 280.5 65.0 exp5 exp5 ALC1KO+ALC1WT
ALC1KO+ALC1G750E 790.0 655.5 407.0 78.0 exp5 exp5 ALC1KO+ALC1G750E
ALC1KO+ALC1E175Q 446.0 272.0 120.5 29.5 exp5 exp5 ALC1KO+ALC1E175Q
ALC1KO+ALC1K77R 424.0 421.5 145.5 11.5 exp5 exp5 ALC1KO+ALC1K77R
library(reshape2)
# reshape to long format
dataset <- melt(dataset, variable.name = "Treatment", value.name = "Counts")

dataset$genotype <- relevel(dataset$genotype, ref = "WT")
dataset$UID <- relevel(dataset$UID, ref = "exp1 WT")

dataset$Olaparib <- gsub("NT","1",dataset$Treatment)
dataset$Olaparib <- gsub("olaparib_|nM","",dataset$Olaparib)
dataset$Olaparib <- log10(as.integer(dataset$Olaparib))


dataset$Offset <- NA
for(uid in levels(dataset$UID)){
        dataset$Offset[dataset$UID == uid] <- mean(dataset$Counts[dataset$UID == uid])
}

dataset$NormCounts <- dataset$Counts / dataset$Offset



dataset$Offset2 <- NA
for(gidx in levels(dataset$genotype)){
        dataset$Offset2[dataset$genotype == gidx] <- mean(dataset$NormCounts[dataset$genotype == gidx & dataset$Olaparib == 0])
}

dataset$NormCounts2 <- dataset$NormCounts / dataset$Offset2



# long format
kable(dataset, row.names = F)
genotype Experiment UID Treatment Counts Olaparib Offset NormCounts Offset2 NormCounts2
WT exp1 exp1 WT NT 733.0 0.000000 689.125 1.0636677 1.070597 0.9935277
ALC1KO exp1 exp1 ALC1KO NT 926.5 0.000000 590.250 1.5696739 1.704506 0.9208964
ALC1KO+ALC1WT exp1 exp1 ALC1KO+ALC1WT NT 541.5 0.000000 427.500 1.2666667 1.299503 0.9747320
ALC1KO+ALC1G750E exp1 exp1 ALC1KO+ALC1G750E NT 777.0 0.000000 476.250 1.6314961 1.531210 1.0654943
ALC1KO+ALC1E175Q exp1 exp1 ALC1KO+ALC1E175Q NT 320.5 0.000000 170.250 1.8825257 1.903494 0.9889843
ALC1KO+ALC1K77R exp1 exp1 ALC1KO+ALC1K77R NT 637.5 0.000000 390.375 1.6330451 1.639896 0.9958226
WT exp2 exp2 WT NT 842.5 0.000000 802.125 1.0503350 1.070597 0.9810743
ALC1KO exp2 exp2 ALC1KO NT 634.0 0.000000 348.250 1.8205312 1.704506 1.0680694
ALC1KO+ALC1WT exp2 exp2 ALC1KO+ALC1WT NT 443.0 0.000000 331.125 1.3378633 1.299503 1.0295196
ALC1KO+ALC1G750E exp2 exp2 ALC1KO+ALC1G750E NT 700.0 0.000000 425.000 1.6470588 1.531210 1.0756580
ALC1KO+ALC1E175Q exp2 exp2 ALC1KO+ALC1E175Q NT 467.5 0.000000 268.000 1.7444030 1.903494 0.9164216
ALC1KO+ALC1K77R exp2 exp2 ALC1KO+ALC1K77R NT 362.5 0.000000 192.625 1.8818949 1.639896 1.1475699
WT exp3 exp3 WT NT 786.5 0.000000 745.375 1.0551736 1.070597 0.9855937
ALC1KO exp3 exp3 ALC1KO NT 777.5 0.000000 444.375 1.7496484 1.704506 1.0264839
ALC1KO+ALC1WT exp3 exp3 ALC1KO+ALC1WT NT 759.5 0.000000 592.125 1.2826684 1.299503 0.9870457
ALC1KO+ALC1G750E exp3 exp3 ALC1KO+ALC1G750E NT 823.5 0.000000 587.375 1.4020004 1.531210 0.9156158
ALC1KO+ALC1E175Q exp3 exp3 ALC1KO+ALC1E175Q NT 401.0 0.000000 206.750 1.9395405 1.903494 1.0189370
ALC1KO+ALC1K77R exp3 exp3 ALC1KO+ALC1K77R NT 695.0 0.000000 454.375 1.5295736 1.639896 0.9327262
WT exp4 exp4 WT NT 845.5 0.000000 757.125 1.1167245 1.070597 1.0430858
ALC1KO exp4 exp4 ALC1KO NT 802.5 0.000000 470.750 1.7047265 1.704506 1.0001291
ALC1KO+ALC1WT exp4 exp4 ALC1KO+ALC1WT NT 799.0 0.000000 691.500 1.1554591 1.299503 0.8891550
ALC1KO+ALC1G750E exp4 exp4 ALC1KO+ALC1G750E NT 971.5 0.000000 725.750 1.3386152 1.531210 0.8742203
ALC1KO+ALC1E175Q exp4 exp4 ALC1KO+ALC1E175Q NT 672.5 0.000000 354.750 1.8957012 1.903494 0.9959061
ALC1KO+ALC1K77R exp4 exp4 ALC1KO+ALC1K77R NT 646.0 0.000000 441.500 1.4631937 1.639896 0.8922481
WT exp5 exp5 WT NT 853.0 0.000000 799.375 1.0670837 1.070597 0.9967184
ALC1KO exp5 exp5 ALC1KO NT 508.0 0.000000 302.750 1.6779521 1.704506 0.9844211
ALC1KO+ALC1WT exp5 exp5 ALC1KO+ALC1WT NT 427.0 0.000000 293.500 1.4548552 1.299503 1.1195478
ALC1KO+ALC1G750E exp5 exp5 ALC1KO+ALC1G750E NT 790.0 0.000000 482.625 1.6368816 1.531210 1.0690115
ALC1KO+ALC1E175Q exp5 exp5 ALC1KO+ALC1E175Q NT 446.0 0.000000 217.000 2.0552995 1.903494 1.0797510
ALC1KO+ALC1K77R exp5 exp5 ALC1KO+ALC1K77R NT 424.0 0.000000 250.625 1.6917706 1.639896 1.0316331
WT exp1 exp1 WT olaparib_30nM 748.5 1.477121 689.125 1.0861600 1.070597 1.0145368
ALC1KO exp1 exp1 ALC1KO olaparib_30nM 737.0 1.477121 590.250 1.2486235 1.704506 0.7325425
ALC1KO+ALC1WT exp1 exp1 ALC1KO+ALC1WT olaparib_30nM 568.0 1.477121 427.500 1.3286550 1.299503 1.0224335
ALC1KO+ALC1G750E exp1 exp1 ALC1KO+ALC1G750E olaparib_30nM 690.5 1.477121 476.250 1.4498688 1.531210 0.9468775
ALC1KO+ALC1E175Q exp1 exp1 ALC1KO+ALC1E175Q olaparib_30nM 243.5 1.477121 170.250 1.4302496 1.903494 0.7513812
ALC1KO+ALC1K77R exp1 exp1 ALC1KO+ALC1K77R olaparib_30nM 574.0 1.477121 390.375 1.4703810 1.639896 0.8966309
WT exp2 exp2 WT olaparib_30nM 800.0 1.477121 802.125 0.9973508 1.070597 0.9315839
ALC1KO exp2 exp2 ALC1KO olaparib_30nM 430.5 1.477121 348.250 1.2361809 1.704506 0.7252427
ALC1KO+ALC1WT exp2 exp2 ALC1KO+ALC1WT olaparib_30nM 405.0 1.477121 331.125 1.2231031 1.299503 0.9412087
ALC1KO+ALC1G750E exp2 exp2 ALC1KO+ALC1G750E olaparib_30nM 476.0 1.477121 425.000 1.1200000 1.531210 0.7314475
ALC1KO+ALC1E175Q exp2 exp2 ALC1KO+ALC1E175Q olaparib_30nM 379.0 1.477121 268.000 1.4141791 1.903494 0.7429386
ALC1KO+ALC1K77R exp2 exp2 ALC1KO+ALC1K77R olaparib_30nM 247.5 1.477121 192.625 1.2848799 1.639896 0.7835133
WT exp3 exp3 WT olaparib_30nM 775.0 1.477121 745.375 1.0397451 1.070597 0.9711826
ALC1KO exp3 exp3 ALC1KO olaparib_30nM 600.5 1.477121 444.375 1.3513361 1.704506 0.7928020
ALC1KO+ALC1WT exp3 exp3 ALC1KO+ALC1WT olaparib_30nM 661.5 1.477121 592.125 1.1171628 1.299503 0.8596849
ALC1KO+ALC1G750E exp3 exp3 ALC1KO+ALC1G750E olaparib_30nM 807.0 1.477121 587.375 1.3739093 1.531210 0.8972701
ALC1KO+ALC1E175Q exp3 exp3 ALC1KO+ALC1E175Q olaparib_30nM 250.5 1.477121 206.750 1.2116082 1.903494 0.6365180
ALC1KO+ALC1K77R exp3 exp3 ALC1KO+ALC1K77R olaparib_30nM 614.0 1.477121 454.375 1.3513067 1.639896 0.8240200
WT exp4 exp4 WT olaparib_30nM 780.5 1.477121 757.125 1.0308734 1.070597 0.9628959
ALC1KO exp4 exp4 ALC1KO olaparib_30nM 659.5 1.477121 470.750 1.4009559 1.704506 0.8219130
ALC1KO+ALC1WT exp4 exp4 ALC1KO+ALC1WT olaparib_30nM 796.0 1.477121 691.500 1.1511208 1.299503 0.8858165
ALC1KO+ALC1G750E exp4 exp4 ALC1KO+ALC1G750E olaparib_30nM 935.5 1.477121 725.750 1.2890114 1.531210 0.8418251
ALC1KO+ALC1E175Q exp4 exp4 ALC1KO+ALC1E175Q olaparib_30nM 443.0 1.477121 354.750 1.2487667 1.903494 0.6560392
ALC1KO+ALC1K77R exp4 exp4 ALC1KO+ALC1K77R olaparib_30nM 578.0 1.477121 441.500 1.3091733 1.639896 0.7983272
WT exp5 exp5 WT olaparib_30nM 854.0 1.477121 799.375 1.0683346 1.070597 0.9978869
ALC1KO exp5 exp5 ALC1KO olaparib_30nM 468.5 1.477121 302.750 1.5474814 1.704506 0.9078766
ALC1KO+ALC1WT exp5 exp5 ALC1KO+ALC1WT olaparib_30nM 401.5 1.477121 293.500 1.3679727 1.299503 1.0526895
ALC1KO+ALC1G750E exp5 exp5 ALC1KO+ALC1G750E olaparib_30nM 655.5 1.477121 482.625 1.3581974 1.531210 0.8870089
ALC1KO+ALC1E175Q exp5 exp5 ALC1KO+ALC1E175Q olaparib_30nM 272.0 1.477121 217.000 1.2534562 1.903494 0.6585029
ALC1KO+ALC1K77R exp5 exp5 ALC1KO+ALC1K77R olaparib_30nM 421.5 1.477121 250.625 1.6817955 1.639896 1.0255504
WT exp1 exp1 WT olaparib_300nM 726.0 2.477121 689.125 1.0535099 1.070597 0.9840397
ALC1KO exp1 exp1 ALC1KO olaparib_300nM 470.0 2.477121 590.250 0.7962728 1.704506 0.4671574
ALC1KO+ALC1WT exp1 exp1 ALC1KO+ALC1WT olaparib_300nM 468.5 2.477121 427.500 1.0959064 1.299503 0.8433277
ALC1KO+ALC1G750E exp1 exp1 ALC1KO+ALC1G750E olaparib_300nM 370.5 2.477121 476.250 0.7779528 1.531210 0.5080639
ALC1KO+ALC1E175Q exp1 exp1 ALC1KO+ALC1E175Q olaparib_300nM 112.0 2.477121 170.250 0.6578561 1.903494 0.3456045
ALC1KO+ALC1K77R exp1 exp1 ALC1KO+ALC1K77R olaparib_300nM 304.5 2.477121 390.375 0.7800192 1.639896 0.4756518
WT exp2 exp2 WT olaparib_300nM 856.0 2.477121 802.125 1.0671653 1.070597 0.9967947
ALC1KO exp2 exp2 ALC1KO olaparib_300nM 270.0 2.477121 348.250 0.7753051 1.704506 0.4548561
ALC1KO+ALC1WT exp2 exp2 ALC1KO+ALC1WT olaparib_300nM 353.5 2.477121 331.125 1.0675727 1.299503 0.8215241
ALC1KO+ALC1G750E exp2 exp2 ALC1KO+ALC1G750E olaparib_300nM 418.0 2.477121 425.000 0.9835294 1.531210 0.6423215
ALC1KO+ALC1E175Q exp2 exp2 ALC1KO+ALC1E175Q olaparib_300nM 190.5 2.477121 268.000 0.7108209 1.903494 0.3734295
ALC1KO+ALC1K77R exp2 exp2 ALC1KO+ALC1K77R olaparib_300nM 138.0 2.477121 192.625 0.7164179 1.639896 0.4368680
WT exp3 exp3 WT olaparib_300nM 734.0 2.477121 745.375 0.9847392 1.070597 0.9198039
ALC1KO exp3 exp3 ALC1KO olaparib_300nM 343.5 2.477121 444.375 0.7729958 1.704506 0.4535012
ALC1KO+ALC1WT exp3 exp3 ALC1KO+ALC1WT olaparib_300nM 693.5 2.477121 592.125 1.1712054 1.299503 0.9012721
ALC1KO+ALC1G750E exp3 exp3 ALC1KO+ALC1G750E olaparib_300nM 608.0 2.477121 587.375 1.0351139 1.531210 0.6760102
ALC1KO+ALC1E175Q exp3 exp3 ALC1KO+ALC1E175Q olaparib_300nM 148.0 2.477121 206.750 0.7158404 1.903494 0.3760665
ALC1KO+ALC1K77R exp3 exp3 ALC1KO+ALC1K77R olaparib_300nM 422.5 2.477121 454.375 0.9298487 1.639896 0.5670170
WT exp4 exp4 WT olaparib_300nM 814.0 2.477121 757.125 1.0751197 1.070597 1.0042246
ALC1KO exp4 exp4 ALC1KO olaparib_300nM 369.0 2.477121 470.750 0.7838555 1.704506 0.4598725
ALC1KO+ALC1WT exp4 exp4 ALC1KO+ALC1WT olaparib_300nM 759.5 2.477121 691.500 1.0983369 1.299503 0.8451980
ALC1KO+ALC1G750E exp4 exp4 ALC1KO+ALC1G750E olaparib_300nM 779.0 2.477121 725.750 1.0733724 1.531210 0.7009960
ALC1KO+ALC1E175Q exp4 exp4 ALC1KO+ALC1E175Q olaparib_300nM 262.0 2.477121 354.750 0.7385483 1.903494 0.3879961
ALC1KO+ALC1K77R exp4 exp4 ALC1KO+ALC1K77R olaparib_300nM 468.5 2.477121 441.500 1.0611552 1.639896 0.6470870
WT exp5 exp5 WT olaparib_300nM 847.0 2.477121 799.375 1.0595778 1.070597 0.9897075
ALC1KO exp5 exp5 ALC1KO olaparib_300nM 208.0 2.477121 302.750 0.6870355 1.704506 0.4030701
ALC1KO+ALC1WT exp5 exp5 ALC1KO+ALC1WT olaparib_300nM 280.5 2.477121 293.500 0.9557070 1.299503 0.7354406
ALC1KO+ALC1G750E exp5 exp5 ALC1KO+ALC1G750E olaparib_300nM 407.0 2.477121 482.625 0.8433048 1.531210 0.5507439
ALC1KO+ALC1E175Q exp5 exp5 ALC1KO+ALC1E175Q olaparib_300nM 120.5 2.477121 217.000 0.5552995 1.903494 0.2917264
ALC1KO+ALC1K77R exp5 exp5 ALC1KO+ALC1K77R olaparib_300nM 145.5 2.477121 250.625 0.5805486 1.639896 0.3540156
WT exp1 exp1 WT olaparib_3000nM 549.0 3.477121 689.125 0.7966624 1.070597 0.7441292
ALC1KO exp1 exp1 ALC1KO olaparib_3000nM 227.5 3.477121 590.250 0.3854299 1.704506 0.2261241
ALC1KO+ALC1WT exp1 exp1 ALC1KO+ALC1WT olaparib_3000nM 132.0 3.477121 427.500 0.3087719 1.299503 0.2376078
ALC1KO+ALC1G750E exp1 exp1 ALC1KO+ALC1G750E olaparib_3000nM 67.0 3.477121 476.250 0.1406824 1.531210 0.0918766
ALC1KO+ALC1E175Q exp1 exp1 ALC1KO+ALC1E175Q olaparib_3000nM 5.0 3.477121 170.250 0.0293686 1.903494 0.0154288
ALC1KO+ALC1K77R exp1 exp1 ALC1KO+ALC1K77R olaparib_3000nM 45.5 3.477121 390.375 0.1165546 1.639896 0.0710744
WT exp2 exp2 WT olaparib_3000nM 710.0 3.477121 802.125 0.8851488 1.070597 0.8267807
ALC1KO exp2 exp2 ALC1KO olaparib_3000nM 58.5 3.477121 348.250 0.1679828 1.704506 0.0985521
ALC1KO+ALC1WT exp2 exp2 ALC1KO+ALC1WT olaparib_3000nM 123.0 3.477121 331.125 0.3714609 1.299503 0.2858486
ALC1KO+ALC1G750E exp2 exp2 ALC1KO+ALC1G750E olaparib_3000nM 106.0 3.477121 425.000 0.2494118 1.531210 0.1628854
ALC1KO+ALC1E175Q exp2 exp2 ALC1KO+ALC1E175Q olaparib_3000nM 35.0 3.477121 268.000 0.1305970 1.903494 0.0686091
ALC1KO+ALC1K77R exp2 exp2 ALC1KO+ALC1K77R olaparib_3000nM 22.5 3.477121 192.625 0.1168073 1.639896 0.0712285
WT exp3 exp3 WT olaparib_3000nM 686.0 3.477121 745.375 0.9203421 1.070597 0.8596533
ALC1KO exp3 exp3 ALC1KO olaparib_3000nM 56.0 3.477121 444.375 0.1260197 1.704506 0.0739332
ALC1KO+ALC1WT exp3 exp3 ALC1KO+ALC1WT olaparib_3000nM 254.0 3.477121 592.125 0.4289635 1.299503 0.3300982
ALC1KO+ALC1G750E exp3 exp3 ALC1KO+ALC1G750E olaparib_3000nM 111.0 3.477121 587.375 0.1889764 1.531210 0.1234163
ALC1KO+ALC1E175Q exp3 exp3 ALC1KO+ALC1E175Q olaparib_3000nM 27.5 3.477121 206.750 0.1330109 1.903494 0.0698772
ALC1KO+ALC1K77R exp3 exp3 ALC1KO+ALC1K77R olaparib_3000nM 86.0 3.477121 454.375 0.1892710 1.639896 0.1154165
WT exp4 exp4 WT olaparib_3000nM 588.5 3.477121 757.125 0.7772825 1.070597 0.7260272
ALC1KO exp4 exp4 ALC1KO olaparib_3000nM 52.0 3.477121 470.750 0.1104620 1.704506 0.0648059
ALC1KO+ALC1WT exp4 exp4 ALC1KO+ALC1WT olaparib_3000nM 411.5 3.477121 691.500 0.5950832 1.299503 0.4579315
ALC1KO+ALC1G750E exp4 exp4 ALC1KO+ALC1G750E olaparib_3000nM 217.0 3.477121 725.750 0.2990010 1.531210 0.1952710
ALC1KO+ALC1E175Q exp4 exp4 ALC1KO+ALC1E175Q olaparib_3000nM 41.5 3.477121 354.750 0.1169838 1.903494 0.0614574
ALC1KO+ALC1K77R exp4 exp4 ALC1KO+ALC1K77R olaparib_3000nM 73.5 3.477121 441.500 0.1664779 1.639896 0.1015174
WT exp5 exp5 WT olaparib_3000nM 643.5 3.477121 799.375 0.8050039 1.070597 0.7519207
ALC1KO exp5 exp5 ALC1KO olaparib_3000nM 26.5 3.477121 302.750 0.0875310 1.704506 0.0513527
ALC1KO+ALC1WT exp5 exp5 ALC1KO+ALC1WT olaparib_3000nM 65.0 3.477121 293.500 0.2214651 1.299503 0.1704230
ALC1KO+ALC1G750E exp5 exp5 ALC1KO+ALC1G750E olaparib_3000nM 78.0 3.477121 482.625 0.1616162 1.531210 0.1055480
ALC1KO+ALC1E175Q exp5 exp5 ALC1KO+ALC1E175Q olaparib_3000nM 29.5 3.477121 217.000 0.1359447 1.903494 0.0714185
ALC1KO+ALC1K77R exp5 exp5 ALC1KO+ALC1K77R olaparib_3000nM 11.5 3.477121 250.625 0.0458853 1.639896 0.0279806

Plot Data

library(ggplot2)

# raw data
ggplot(dataset, aes(x=Olaparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=FALSE, colour="#666666") +
        geom_point(aes(colour=Treatment, shape=Experiment), size=2) +        
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        scale_shape_manual(values=14:19) +
        scale_color_manual(values=c("#999999","#0072B2","#CC79A7","#009E73"))

# Counts Linear
ggplot(dataset, aes(x=Olaparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)")

# NormCounts Linear
ggplot(dataset, aes(x=Olaparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)")

# NormCounts2 Linear
ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)")

# Counts Quadratic
ggplot(dataset, aes(x=Olaparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") 

# NormCounts Quadratic
ggplot(dataset, aes(x=Olaparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") 

# NormCounts2 Quadratic
ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") 

# Counts Cubic
ggplot(dataset, aes(x=Olaparib, y=Counts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") 

# NormCounts Cubic
ggplot(dataset, aes(x=Olaparib, y=NormCounts)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") 

# NormCounts2 Cubic
ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) + 
        theme_bw() +
        theme(panel.grid=element_blank(), text = element_text(size=14)) +
        geom_point(colour="#333333") +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") 

library(Cairo)

cairo_pdf("Figure1E_v1.pdf", width = 14, height = 4, family = "Arial")

ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000','#000080','#800000','#808080','#808080','#808080'))

dev.off()
## quartz_off_screen 
##                 2
cairo_pdf("Figure1E_v2.pdf", width = 6, height = 4, family = "Arial")

ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        #facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000','#000080','#800000','#808000','#800080','#008080'))

dev.off()
## quartz_off_screen 
##                 2
cairo_pdf("Figure1E_v3.pdf", width = 6, height = 4, family = "Arial")

ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
        #facet_grid(. ~ genotype) +
        xlab(label = "Olaparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        scale_color_manual(values=c('#000000',"#0072B2","#D55E00","#E69F00","#009E73","#CC79A7"))

dev.off()
## quartz_off_screen 
##                 2
cairo_pdf("Figure1E_v4.pdf", width = 6, height = 4, family = "Arial")

ggplot(dataset, aes(x=Olaparib, y=NormCounts2)) +
        theme_bw() +
        theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(), 
              axis.line = element_line(colour = "black"), text = element_text(size=14),
              panel.border = element_blank(), panel.background = element_blank()) +
        geom_point(aes(colour = genotype, shape = genotype)) +
        geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, 
                    aes(colour = genotype, linetype = genotype), fill='#F0F0F0', size=0.5) +
        #facet_grid(. ~ genotype) +
        #guides(linetype = guide_legend(override.aes= list(color = "#555555"))) +
        scale_linetype_manual(values=c("solid", "solid","solid","dotted","dashed","twodash")) +
        scale_shape_manual(values=c(20,20,20,19,15,17)) +
        xlab(label = "Olaparib (log10 nM)") +
        ylab(label = "Normalized Counts") +
        #scale_color_manual(values=c('#000000','#000080','#800000','#333333','#777777','#AAAAAA')) 
        scale_color_manual(values=c('#000000','#000080','#800000','#808080','#808080','#808080')) 


dev.off()
## quartz_off_screen 
##                 2

Models

library(MASS)
library(DHARMa)
library(lme4)
library(lmerTest)
library(bbmle)

Linear formula

fit1 <- lm(Counts ~ Experiment + Olaparib*genotype, data = dataset)
print(summary(fit1))
## 
## Call:
## lm(formula = Counts ~ Experiment + Olaparib * genotype, data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -208.60  -82.02  -23.46   69.42  249.76 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         832.86      50.61  16.457  < 2e-16 ***
## Experimentexp2                      -62.77      33.70  -1.862 0.065365 .  
## Experimentexp3                       47.77      33.70   1.417 0.159362    
## Experimentexp4                      116.27      33.70   3.450 0.000812 ***
## Experimentexp5                      -66.31      33.70  -1.968 0.051787 .  
## Olaparib                            -43.72      20.32  -2.152 0.033740 *  
## genotypeALC1KO                      -61.24      64.91  -0.943 0.347680    
## genotypeALC1KO+ALC1WT              -180.36      64.91  -2.779 0.006481 ** 
## genotypeALC1KO+ALC1G750E             57.87      64.91   0.891 0.374732    
## genotypeALC1KO+ALC1E175Q           -362.86      64.91  -5.590 1.84e-07 ***
## genotypeALC1KO+ALC1K77R            -226.00      64.91  -3.482 0.000730 ***
## Olaparib:genotypeALC1KO            -143.24      28.74  -4.984 2.49e-06 ***
## Olaparib:genotypeALC1KO+ALC1WT      -59.81      28.74  -2.081 0.039877 *  
## Olaparib:genotypeALC1KO+ALC1G750E  -149.15      28.74  -5.190 1.05e-06 ***
## Olaparib:genotypeALC1KO+ALC1E175Q   -82.04      28.74  -2.855 0.005201 ** 
## Olaparib:genotypeALC1KO+ALC1K77R   -100.51      28.74  -3.497 0.000693 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 116.8 on 104 degrees of freedom
## Multiple R-squared:  0.8446, Adjusted R-squared:  0.8222 
## F-statistic: 37.68 on 15 and 104 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit1))
## AIC:  1499.788
simres <- simulateResiduals(fittedModel = fit1)
plot(simres)

fit2 <- lm(NormCounts ~ Olaparib*genotype, data = dataset)
print(summary(fit2))
## 
## Call:
## lm(formula = NormCounts ~ Olaparib * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.38749 -0.11961 -0.00834  0.09735  0.51585 
## 
## Coefficients:
##                                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        1.10763    0.07142  15.508  < 2e-16 ***
## Olaparib                          -0.05793    0.03162  -1.832  0.06968 .  
## genotypeALC1KO                     0.71591    0.10101   7.088 1.47e-10 ***
## genotypeALC1KO+ALC1WT              0.34102    0.10101   3.376  0.00102 ** 
## genotypeALC1KO+ALC1G750E           0.57509    0.10101   5.694 1.08e-07 ***
## genotypeALC1KO+ALC1E175Q           0.86054    0.10101   8.520 1.05e-13 ***
## genotypeALC1KO+ALC1K77R            0.70213    0.10101   6.951 2.87e-10 ***
## Olaparib:genotypeALC1KO           -0.38535    0.04472  -8.618 6.32e-14 ***
## Olaparib:genotypeALC1KO+ALC1WT    -0.18356    0.04472  -4.105 7.88e-05 ***
## Olaparib:genotypeALC1KO+ALC1G750E -0.30955    0.04472  -6.922 3.31e-10 ***
## Olaparib:genotypeALC1KO+ALC1E175Q -0.46319    0.04472 -10.358  < 2e-16 ***
## Olaparib:genotypeALC1KO+ALC1K77R  -0.37793    0.04472  -8.452 1.49e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1817 on 108 degrees of freedom
## Multiple R-squared:  0.8878, Adjusted R-squared:  0.8764 
## F-statistic: 77.72 on 11 and 108 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit2))
## AIC:  -55.43504
simres <- simulateResiduals(fittedModel = fit2)
plot(simres)

fit3 <- lm(NormCounts2 ~ Olaparib*genotype, data = dataset)
print(summary(fit3))
## 
## Call:
## lm(formula = NormCounts2 ~ Olaparib * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.298184 -0.079735 -0.005049  0.074646  0.314565 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        1.0345920  0.0476975  21.691  < 2e-16 ***
## Olaparib                          -0.0541132  0.0211165  -2.563   0.0118 *  
## genotypeALC1KO                     0.0352449  0.0674545   0.522   0.6024    
## genotypeALC1KO+ALC1WT              0.0801845  0.0674545   1.189   0.2372    
## genotypeALC1KO+ALC1G750E           0.0643540  0.0674545   0.954   0.3422    
## genotypeALC1KO+ALC1E175Q          -0.0006134  0.0674545  -0.009   0.9928    
## genotypeALC1KO+ALC1K77R            0.0689924  0.0674545   1.023   0.3087    
## Olaparib:genotypeALC1KO           -0.2059504  0.0298632  -6.896 3.76e-10 ***
## Olaparib:genotypeALC1KO+ALC1WT    -0.1317215  0.0298632  -4.411 2.44e-05 ***
## Olaparib:genotypeALC1KO+ALC1G750E -0.1858794  0.0298632  -6.224 9.42e-09 ***
## Olaparib:genotypeALC1KO+ALC1E175Q -0.2196611  0.0298632  -7.356 3.90e-11 ***
## Olaparib:genotypeALC1KO+ALC1K77R  -0.2116736  0.0298632  -7.088 1.47e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1213 on 108 degrees of freedom
## Multiple R-squared:  0.8863, Adjusted R-squared:  0.8747 
## F-statistic: 76.54 on 11 and 108 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit3))
## AIC:  -152.3274
simres <- simulateResiduals(fittedModel = fit3)
plot(simres)

fit4 <- lmer(Counts ~ Olaparib*genotype + (1|UID), data = dataset)
print(summary(fit4))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ Olaparib * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 1370.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.73359 -0.65041  0.02685  0.54525  2.16261 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 10592    102.92  
##  Residual              9021     94.98  
## Number of obs: 120, groups:  UID, 30
## 
## Fixed effects:
##                                   Estimate Std. Error      df t value Pr(>|t|)
## (Intercept)                         839.86      59.27   43.19  14.170  < 2e-16
## Olaparib                            -43.72      16.53   84.00  -2.645 0.009752
## genotypeALC1KO                      -61.24      83.82   43.19  -0.731 0.468971
## genotypeALC1KO+ALC1WT              -180.36      83.82   43.19  -2.152 0.037044
## genotypeALC1KO+ALC1G750E             57.87      83.82   43.19   0.690 0.493631
## genotypeALC1KO+ALC1E175Q           -362.86      83.82   43.19  -4.329 8.73e-05
## genotypeALC1KO+ALC1K77R            -226.00      83.82   43.19  -2.696 0.009954
## Olaparib:genotypeALC1KO            -143.24      23.38   84.00  -6.127 2.78e-08
## Olaparib:genotypeALC1KO+ALC1WT      -59.81      23.38   84.00  -2.558 0.012315
## Olaparib:genotypeALC1KO+ALC1G750E  -149.15      23.38   84.00  -6.380 9.23e-09
## Olaparib:genotypeALC1KO+ALC1E175Q   -82.04      23.38   84.00  -3.509 0.000725
## Olaparib:genotypeALC1KO+ALC1K77R   -100.51      23.38   84.00  -4.299 4.60e-05
##                                      
## (Intercept)                       ***
## Olaparib                          ** 
## genotypeALC1KO                       
## genotypeALC1KO+ALC1WT             *  
## genotypeALC1KO+ALC1G750E             
## genotypeALC1KO+ALC1E175Q          ***
## genotypeALC1KO+ALC1K77R           ** 
## Olaparib:genotypeALC1KO           ***
## Olaparib:genotypeALC1KO+ALC1WT    *  
## Olaparib:genotypeALC1KO+ALC1G750E ***
## Olaparib:genotypeALC1KO+ALC1E175Q ***
## Olaparib:genotypeALC1KO+ALC1K77R  ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##                (Intr) Olaprb gnALC1KO gALC1KO+ALC1W gALC1KO+ALC1G gALC1KO+ALC1E
## Olaparib       -0.518                                                          
## gntypALC1KO    -0.707  0.366                                                   
## gALC1KO+ALC1W  -0.707  0.366  0.500                                            
## gALC1KO+ALC1G  -0.707  0.366  0.500    0.500                                   
## gALC1KO+ALC1E  -0.707  0.366  0.500    0.500         0.500                     
## gALC1KO+ALC1K  -0.707  0.366  0.500    0.500         0.500         0.500       
## Olpr:ALC1KO     0.366 -0.707 -0.518   -0.259        -0.259        -0.259       
## O:ALC1KO+ALC1W  0.366 -0.707 -0.259   -0.518        -0.259        -0.259       
## O:ALC1KO+ALC1G  0.366 -0.707 -0.259   -0.259        -0.518        -0.259       
## O:ALC1KO+ALC1E  0.366 -0.707 -0.259   -0.259        -0.259        -0.518       
## O:ALC1KO+ALC1K  0.366 -0.707 -0.259   -0.259        -0.259        -0.259       
##                gALC1KO+ALC1K Ol:ALC1KO O:ALC1KO+ALC1W O:ALC1KO+ALC1G
## Olaparib                                                            
## gntypALC1KO                                                         
## gALC1KO+ALC1W                                                       
## gALC1KO+ALC1G                                                       
## gALC1KO+ALC1E                                                       
## gALC1KO+ALC1K                                                       
## Olpr:ALC1KO    -0.259                                               
## O:ALC1KO+ALC1W -0.259         0.500                                 
## O:ALC1KO+ALC1G -0.259         0.500     0.500                       
## O:ALC1KO+ALC1E -0.259         0.500     0.500          0.500        
## O:ALC1KO+ALC1K -0.518         0.500     0.500          0.500        
##                O:ALC1KO+ALC1E
## Olaparib                     
## gntypALC1KO                  
## gALC1KO+ALC1W                
## gALC1KO+ALC1G                
## gALC1KO+ALC1E                
## gALC1KO+ALC1K                
## Olpr:ALC1KO                  
## O:ALC1KO+ALC1W               
## O:ALC1KO+ALC1G               
## O:ALC1KO+ALC1E               
## O:ALC1KO+ALC1K  0.500
cat("AIC: ", AIC(fit4))
## AIC:  1398.794
simres <- simulateResiduals(fittedModel = fit4)
plot(simres)

Quadratic formula

fit5 <- lm(Counts ~ Experiment + poly(Olaparib, 2)*genotype, data = dataset)
print(summary(fit5))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Olaparib, 2) * genotype, 
##     data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -183.15  -64.81  -11.16   69.43  199.47 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                   751.63      28.12  26.730
## Experimentexp2                                -62.77      28.12  -2.232
## Experimentexp3                                 47.77      28.12   1.699
## Experimentexp4                                116.27      28.12   4.135
## Experimentexp5                                -66.31      28.12  -2.358
## poly(Olaparib, 2)1                           -615.34     238.60  -2.579
## poly(Olaparib, 2)2                           -413.83     238.60  -1.734
## genotypeALC1KO                               -327.35      30.80 -10.627
## genotypeALC1KO+ALC1WT                        -291.47      30.80  -9.463
## genotypeALC1KO+ALC1G750E                     -219.22      30.80  -7.117
## genotypeALC1KO+ALC1E175Q                     -515.27      30.80 -16.728
## genotypeALC1KO+ALC1K77R                      -412.72      30.80 -13.399
## poly(Olaparib, 2)1:genotypeALC1KO           -2015.86     337.43  -5.974
## poly(Olaparib, 2)2:genotypeALC1KO            -123.21     337.43  -0.365
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT     -841.71     337.43  -2.494
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT     -477.26     337.43  -1.414
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E -2099.03     337.43  -6.221
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E  -658.35     337.43  -1.951
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q -1154.55     337.43  -3.422
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q   252.02     337.43   0.747
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R  -1414.46     337.43  -4.192
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R   -291.44     337.43  -0.864
##                                             Pr(>|t|)    
## (Intercept)                                  < 2e-16 ***
## Experimentexp2                              0.027871 *  
## Experimentexp3                              0.092516 .  
## Experimentexp4                              7.50e-05 ***
## Experimentexp5                              0.020346 *  
## poly(Olaparib, 2)1                          0.011396 *  
## poly(Olaparib, 2)2                          0.085990 .  
## genotypeALC1KO                               < 2e-16 ***
## genotypeALC1KO+ALC1WT                       1.78e-15 ***
## genotypeALC1KO+ALC1G750E                    1.84e-10 ***
## genotypeALC1KO+ALC1E175Q                     < 2e-16 ***
## genotypeALC1KO+ALC1K77R                      < 2e-16 ***
## poly(Olaparib, 2)1:genotypeALC1KO           3.73e-08 ***
## poly(Olaparib, 2)2:genotypeALC1KO           0.715803    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT    0.014287 *  
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT    0.160418    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E 1.22e-08 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E 0.053906 .  
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q 0.000909 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q 0.456926    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R  6.07e-05 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R  0.389858    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 97.41 on 98 degrees of freedom
## Multiple R-squared:  0.8981, Adjusted R-squared:  0.8762 
## F-statistic: 41.12 on 21 and 98 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit5))
## AIC:  1461.179
simres <- simulateResiduals(fittedModel = fit5)
plot(simres)

fit6 <- lm(NormCounts ~ poly(Olaparib, 2)*genotype, data = dataset)
print(summary(fit6))
## 
## Call:
## lm(formula = NormCounts ~ poly(Olaparib, 2) * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.28798 -0.06115 -0.01004  0.06064  0.30835 
## 
## Coefficients:
##                                               Estimate Std. Error t value
## (Intercept)                                  1.000e+00  2.508e-02  39.879
## poly(Olaparib, 2)1                          -8.153e-01  2.747e-01  -2.968
## poly(Olaparib, 2)2                          -5.496e-01  2.747e-01  -2.001
## genotypeALC1KO                               2.722e-16  3.546e-02   0.000
## genotypeALC1KO+ALC1WT                       -4.881e-16  3.546e-02   0.000
## genotypeALC1KO+ALC1G750E                    -8.063e-16  3.546e-02   0.000
## genotypeALC1KO+ALC1E175Q                     3.927e-17  3.546e-02   0.000
## genotypeALC1KO+ALC1K77R                     -3.256e-16  3.546e-02   0.000
## poly(Olaparib, 2)1:genotypeALC1KO           -5.423e+00  3.885e-01 -13.960
## poly(Olaparib, 2)2:genotypeALC1KO           -7.516e-01  3.885e-01  -1.935
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT    -2.583e+00  3.885e-01  -6.650
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT    -1.442e+00  3.885e-01  -3.712
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E -4.356e+00  3.885e-01 -11.214
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E -1.352e+00  3.885e-01  -3.480
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q -6.519e+00  3.885e-01 -16.780
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q -1.132e-01  3.885e-01  -0.291
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R  -5.319e+00  3.885e-01 -13.692
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R  -1.367e+00  3.885e-01  -3.519
##                                             Pr(>|t|)    
## (Intercept)                                  < 2e-16 ***
## poly(Olaparib, 2)1                          0.003734 ** 
## poly(Olaparib, 2)2                          0.048085 *  
## genotypeALC1KO                              1.000000    
## genotypeALC1KO+ALC1WT                       1.000000    
## genotypeALC1KO+ALC1G750E                    1.000000    
## genotypeALC1KO+ALC1E175Q                    1.000000    
## genotypeALC1KO+ALC1K77R                     1.000000    
## poly(Olaparib, 2)1:genotypeALC1KO            < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO           0.055786 .  
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT    1.48e-09 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT    0.000335 ***
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E  < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E 0.000739 ***
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q  < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q 0.771262    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R   < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R  0.000648 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1121 on 102 degrees of freedom
## Multiple R-squared:  0.9596, Adjusted R-squared:  0.9529 
## F-statistic: 142.7 on 17 and 102 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit6))
## AIC:  -166.0738
simres <- simulateResiduals(fittedModel = fit6)
plot(simres)

fit7 <- lm(NormCounts2 ~ poly(Olaparib, 2)*genotype, data = dataset)
print(summary(fit7))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Olaparib, 2) * genotype, data = dataset)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.17561 -0.03909 -0.00634  0.04860  0.18803 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                  0.93406    0.01645  56.766
## poly(Olaparib, 2)1                          -0.76156    0.18025  -4.225
## poly(Olaparib, 2)2                          -0.51333    0.18025  -2.848
## genotypeALC1KO                              -0.34738    0.02327 -14.928
## genotypeALC1KO+ALC1WT                       -0.16453    0.02327  -7.071
## genotypeALC1KO+ALC1G750E                    -0.28098    0.02327 -12.075
## genotypeALC1KO+ALC1E175Q                    -0.40871    0.02327 -17.564
## genotypeALC1KO+ALC1K77R                     -0.32426    0.02327 -13.935
## poly(Olaparib, 2)1:genotypeALC1KO           -2.89844    0.25491 -11.370
## poly(Olaparib, 2)2:genotypeALC1KO           -0.25005    0.25491  -0.981
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT    -1.85378    0.25491  -7.272
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT    -1.01926    0.25491  -3.998
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E -2.61597    0.25491 -10.262
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E -0.72845    0.25491  -2.858
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q -3.09140    0.25491 -12.127
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q  0.16512    0.25491   0.648
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R  -2.97898    0.25491 -11.686
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R  -0.65544    0.25491  -2.571
##                                             Pr(>|t|)    
## (Intercept)                                  < 2e-16 ***
## poly(Olaparib, 2)1                          5.21e-05 ***
## poly(Olaparib, 2)2                          0.005323 ** 
## genotypeALC1KO                               < 2e-16 ***
## genotypeALC1KO+ALC1WT                       1.97e-10 ***
## genotypeALC1KO+ALC1G750E                     < 2e-16 ***
## genotypeALC1KO+ALC1E175Q                     < 2e-16 ***
## genotypeALC1KO+ALC1K77R                      < 2e-16 ***
## poly(Olaparib, 2)1:genotypeALC1KO            < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO           0.328948    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT    7.42e-11 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT    0.000121 ***
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E  < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E 0.005174 ** 
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q  < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q 0.518592    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R   < 2e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R  0.011576 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.07359 on 102 degrees of freedom
## Multiple R-squared:  0.9605, Adjusted R-squared:  0.9539 
## F-statistic: 145.9 on 17 and 102 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit7))
## AIC:  -267.1881
simres <- simulateResiduals(fittedModel = fit7)
plot(simres)

fit8 <- lmer(Counts ~ poly(Olaparib, 2)*genotype + (1|UID), data = dataset)
print(summary(fit8))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Olaparib, 2) * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 1181.9
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.48528 -0.55156 -0.00367  0.56484  2.07079 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 11982    109.46  
##  Residual              3461     58.83  
## Number of obs: 120, groups:  UID, 30
## 
## Fixed effects:
##                                             Estimate Std. Error       df
## (Intercept)                                   758.62      50.69    24.00
## poly(Olaparib, 2)1                           -615.34     144.11    78.00
## poly(Olaparib, 2)2                           -413.83     144.11    78.00
## genotypeALC1KO                               -327.35      71.69    24.00
## genotypeALC1KO+ALC1WT                        -291.47      71.69    24.00
## genotypeALC1KO+ALC1G750E                     -219.22      71.69    24.00
## genotypeALC1KO+ALC1E175Q                     -515.27      71.69    24.00
## genotypeALC1KO+ALC1K77R                      -412.72      71.69    24.00
## poly(Olaparib, 2)1:genotypeALC1KO           -2015.86     203.80    78.00
## poly(Olaparib, 2)2:genotypeALC1KO            -123.21     203.80    78.00
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT     -841.71     203.80    78.00
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT     -477.26     203.80    78.00
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E -2099.03     203.80    78.00
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E  -658.35     203.80    78.00
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q -1154.55     203.80    78.00
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q   252.02     203.80    78.00
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R  -1414.46     203.80    78.00
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R   -291.44     203.80    78.00
##                                             t value Pr(>|t|)    
## (Intercept)                                  14.966 1.14e-13 ***
## poly(Olaparib, 2)1                           -4.270 5.46e-05 ***
## poly(Olaparib, 2)2                           -2.872 0.005256 ** 
## genotypeALC1KO                               -4.566 0.000125 ***
## genotypeALC1KO+ALC1WT                        -4.066 0.000446 ***
## genotypeALC1KO+ALC1G750E                     -3.058 0.005403 ** 
## genotypeALC1KO+ALC1E175Q                     -7.188 1.99e-07 ***
## genotypeALC1KO+ALC1K77R                      -5.757 6.20e-06 ***
## poly(Olaparib, 2)1:genotypeALC1KO            -9.891 2.04e-15 ***
## poly(Olaparib, 2)2:genotypeALC1KO            -0.605 0.547239    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1WT     -4.130 9.03e-05 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1WT     -2.342 0.021745 *  
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1G750E -10.299 3.36e-16 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1G750E  -3.230 0.001811 ** 
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1E175Q  -5.665 2.36e-07 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1E175Q   1.237 0.219946    
## poly(Olaparib, 2)1:genotypeALC1KO+ALC1K77R   -6.940 1.02e-09 ***
## poly(Olaparib, 2)2:genotypeALC1KO+ALC1K77R   -1.430 0.156701    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("AIC: ", AIC(fit8))
## AIC:  1221.92
simres <- simulateResiduals(fittedModel = fit8)
plot(simres)

Cubic formula

fit9 <- lm(Counts ~ Experiment + poly(Olaparib, 3)*genotype, data = dataset)
print(summary(fit9))
## 
## Call:
## lm(formula = Counts ~ Experiment + poly(Olaparib, 3) * genotype, 
##     data = dataset)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -169.74  -66.56  -14.64   75.27  203.79 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                   751.63      28.41  26.459
## Experimentexp2                                -62.77      28.41  -2.210
## Experimentexp3                                 47.77      28.41   1.682
## Experimentexp4                                116.27      28.41   4.093
## Experimentexp5                                -66.31      28.41  -2.334
## poly(Olaparib, 3)1                           -615.34     241.05  -2.553
## poly(Olaparib, 3)2                           -413.83     241.05  -1.717
## poly(Olaparib, 3)3                           -254.21     241.05  -1.055
## genotypeALC1KO                               -327.35      31.12 -10.519
## genotypeALC1KO+ALC1WT                        -291.48      31.12  -9.366
## genotypeALC1KO+ALC1G750E                     -219.23      31.12  -7.045
## genotypeALC1KO+ALC1E175Q                     -515.28      31.12 -16.558
## genotypeALC1KO+ALC1K77R                      -412.72      31.12 -13.263
## poly(Olaparib, 3)1:genotypeALC1KO           -2015.86     340.89  -5.913
## poly(Olaparib, 3)2:genotypeALC1KO            -123.21     340.89  -0.361
## poly(Olaparib, 3)3:genotypeALC1KO             420.29     340.89   1.233
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT     -841.71     340.89  -2.469
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT     -477.26     340.89  -1.400
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT      -72.90     340.89  -0.214
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E -2099.03     340.89  -6.157
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E  -658.35     340.89  -1.931
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E   111.29     340.89   0.326
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q -1154.55     340.89  -3.387
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q   252.02     340.89   0.739
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q   333.23     340.89   0.978
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R  -1414.46     340.89  -4.149
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R   -291.44     340.89  -0.855
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R    341.99     340.89   1.003
##                                             Pr(>|t|)    
## (Intercept)                                  < 2e-16 ***
## Experimentexp2                               0.02961 *  
## Experimentexp3                               0.09603 .  
## Experimentexp4                              9.13e-05 ***
## Experimentexp5                               0.02176 *  
## poly(Olaparib, 3)1                           0.01233 *  
## poly(Olaparib, 3)2                           0.08938 .  
## poly(Olaparib, 3)3                           0.29437    
## genotypeALC1KO                               < 2e-16 ***
## genotypeALC1KO+ALC1WT                       4.91e-15 ***
## genotypeALC1KO+ALC1G750E                    3.31e-10 ***
## genotypeALC1KO+ALC1E175Q                     < 2e-16 ***
## genotypeALC1KO+ALC1K77R                      < 2e-16 ***
## poly(Olaparib, 3)1:genotypeALC1KO           5.64e-08 ***
## poly(Olaparib, 3)2:genotypeALC1KO            0.71861    
## poly(Olaparib, 3)3:genotypeALC1KO            0.22075    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT     0.01539 *  
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT     0.16487    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT     0.83115    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E 1.91e-08 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E  0.05653 .  
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E  0.74482    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q  0.00104 ** 
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q  0.46161    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q  0.33087    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R  7.43e-05 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R   0.39481    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R   0.31838    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 98.41 on 92 degrees of freedom
## Multiple R-squared:  0.9023, Adjusted R-squared:  0.8737 
## F-statistic: 31.48 on 27 and 92 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit9))
## AIC:  1468.047
simres <- simulateResiduals(fittedModel = fit9)
plot(simres)

fit10 <- lm(NormCounts ~ poly(Olaparib, 3)*genotype, data = dataset)
print(summary(fit10))
## 
## Call:
## lm(formula = NormCounts ~ poly(Olaparib, 3) * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.233049 -0.063718 -0.005164  0.045388  0.262288 
## 
## Coefficients:
##                                               Estimate Std. Error t value
## (Intercept)                                  1.000e+00  2.403e-02  41.615
## poly(Olaparib, 3)1                          -8.153e-01  2.632e-01  -3.097
## poly(Olaparib, 3)2                          -5.496e-01  2.632e-01  -2.088
## poly(Olaparib, 3)3                          -3.309e-01  2.632e-01  -1.257
## genotypeALC1KO                               8.034e-16  3.398e-02   0.000
## genotypeALC1KO+ALC1WT                        1.882e-17  3.398e-02   0.000
## genotypeALC1KO+ALC1G750E                    -8.380e-17  3.398e-02   0.000
## genotypeALC1KO+ALC1E175Q                    -5.151e-16  3.398e-02   0.000
## genotypeALC1KO+ALC1K77R                     -1.507e-16  3.398e-02   0.000
## poly(Olaparib, 3)1:genotypeALC1KO           -5.423e+00  3.723e-01 -14.568
## poly(Olaparib, 3)2:genotypeALC1KO           -7.516e-01  3.723e-01  -2.019
## poly(Olaparib, 3)3:genotypeALC1KO            7.530e-01  3.723e-01   2.023
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT    -2.583e+00  3.723e-01  -6.939
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT    -1.442e+00  3.723e-01  -3.874
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT    -2.937e-01  3.723e-01  -0.789
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E -4.356e+00  3.723e-01 -11.702
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E -1.352e+00  3.723e-01  -3.631
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E  8.477e-02  3.723e-01   0.228
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q -6.519e+00  3.723e-01 -17.511
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q -1.132e-01  3.723e-01  -0.304
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q  7.013e-01  3.723e-01   1.884
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R  -5.319e+00  3.723e-01 -14.288
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R  -1.367e+00  3.723e-01  -3.672
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R   7.421e-01  3.723e-01   1.993
##                                             Pr(>|t|)    
## (Intercept)                                  < 2e-16 ***
## poly(Olaparib, 3)1                          0.002560 ** 
## poly(Olaparib, 3)2                          0.039467 *  
## poly(Olaparib, 3)3                          0.211811    
## genotypeALC1KO                              1.000000    
## genotypeALC1KO+ALC1WT                       1.000000    
## genotypeALC1KO+ALC1G750E                    1.000000    
## genotypeALC1KO+ALC1E175Q                    1.000000    
## genotypeALC1KO+ALC1K77R                     1.000000    
## poly(Olaparib, 3)1:genotypeALC1KO            < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO           0.046273 *  
## poly(Olaparib, 3)3:genotypeALC1KO           0.045893 *  
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT    4.62e-10 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT    0.000196 ***
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT    0.432117    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E  < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E 0.000455 ***
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E 0.820346    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q  < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q 0.761641    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q 0.062616 .  
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R   < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R  0.000395 ***
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R  0.049054 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1075 on 96 degrees of freedom
## Multiple R-squared:  0.9651, Adjusted R-squared:  0.9568 
## F-statistic: 115.5 on 23 and 96 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit10))
## AIC:  -171.5765
simres <- simulateResiduals(fittedModel = fit10)
plot(simres)

fit11 <- lm(NormCounts2 ~ poly(Olaparib, 3)*genotype, data = dataset)
print(summary(fit11))
## 
## Call:
## lm(formula = NormCounts2 ~ poly(Olaparib, 3) * genotype, data = dataset)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.142112 -0.042428 -0.003688  0.031983  0.161550 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                  0.93406    0.01559  59.918
## poly(Olaparib, 3)1                          -0.76156    0.17077  -4.460
## poly(Olaparib, 3)2                          -0.51333    0.17077  -3.006
## poly(Olaparib, 3)3                          -0.30906    0.17077  -1.810
## genotypeALC1KO                              -0.34738    0.02205 -15.757
## genotypeALC1KO+ALC1WT                       -0.16453    0.02205  -7.463
## genotypeALC1KO+ALC1G750E                    -0.28098    0.02205 -12.745
## genotypeALC1KO+ALC1E175Q                    -0.40871    0.02205 -18.539
## genotypeALC1KO+ALC1K77R                     -0.32426    0.02205 -14.708
## poly(Olaparib, 3)1:genotypeALC1KO           -2.89844    0.24150 -12.002
## poly(Olaparib, 3)2:genotypeALC1KO           -0.25005    0.24150  -1.035
## poly(Olaparib, 3)3:genotypeALC1KO            0.55668    0.24150   2.305
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT    -1.85378    0.24150  -7.676
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT    -1.01926    0.24150  -4.220
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT    -0.17155    0.24150  -0.710
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E -2.61597    0.24150 -10.832
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E -0.72845    0.24150  -3.016
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E  0.14833    0.24150   0.614
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q -3.09140    0.24150 -12.801
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q  0.16512    0.24150   0.684
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q  0.50365    0.24150   2.085
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R  -2.97898    0.24150 -12.335
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R  -0.65544    0.24150  -2.714
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R   0.55981    0.24150   2.318
##                                             Pr(>|t|)    
## (Intercept)                                  < 2e-16 ***
## poly(Olaparib, 3)1                          2.23e-05 ***
## poly(Olaparib, 3)2                           0.00338 ** 
## poly(Olaparib, 3)3                           0.07346 .  
## genotypeALC1KO                               < 2e-16 ***
## genotypeALC1KO+ALC1WT                       3.82e-11 ***
## genotypeALC1KO+ALC1G750E                     < 2e-16 ***
## genotypeALC1KO+ALC1E175Q                     < 2e-16 ***
## genotypeALC1KO+ALC1K77R                      < 2e-16 ***
## poly(Olaparib, 3)1:genotypeALC1KO            < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO            0.30309    
## poly(Olaparib, 3)3:genotypeALC1KO            0.02332 *  
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT    1.37e-11 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT    5.53e-05 ***
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT     0.47921    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E  < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E  0.00327 ** 
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E  0.54053    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q  < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q  0.49580    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q  0.03968 *  
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R   < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R   0.00788 ** 
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R   0.02257 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.06972 on 96 degrees of freedom
## Multiple R-squared:  0.9666, Adjusted R-squared:  0.9586 
## F-statistic: 120.9 on 23 and 96 DF,  p-value: < 2.2e-16
cat("AIC: ", AIC(fit11))
## AIC:  -275.4297
simres <- simulateResiduals(fittedModel = fit11)
plot(simres)

fit12 <- lmer(Counts ~ poly(Olaparib, 3)*genotype + (1|UID), data = dataset)
print(summary(fit12))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Olaparib, 3) * genotype + (1 | UID)
##    Data: dataset
## 
## REML criterion at convergence: 1099.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.28860 -0.46993 -0.00876  0.55742  2.09019 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  UID      (Intercept) 12045    109.75  
##  Residual              3209     56.65  
## Number of obs: 120, groups:  UID, 30
## 
## Fixed effects:
##                                             Estimate Std. Error       df
## (Intercept)                                   758.62      50.69    24.00
## poly(Olaparib, 3)1                           -615.34     138.76    72.00
## poly(Olaparib, 3)2                           -413.83     138.76    72.00
## poly(Olaparib, 3)3                           -254.21     138.76    72.00
## genotypeALC1KO                               -327.35      71.69    24.00
## genotypeALC1KO+ALC1WT                        -291.47      71.69    24.00
## genotypeALC1KO+ALC1G750E                     -219.22      71.69    24.00
## genotypeALC1KO+ALC1E175Q                     -515.27      71.69    24.00
## genotypeALC1KO+ALC1K77R                      -412.72      71.69    24.00
## poly(Olaparib, 3)1:genotypeALC1KO           -2015.86     196.23    72.00
## poly(Olaparib, 3)2:genotypeALC1KO            -123.21     196.23    72.00
## poly(Olaparib, 3)3:genotypeALC1KO             420.29     196.23    72.00
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT     -841.71     196.23    72.00
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT     -477.26     196.23    72.00
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT      -72.90     196.23    72.00
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E -2099.03     196.23    72.00
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E  -658.35     196.23    72.00
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E   111.29     196.23    72.00
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q -1154.55     196.23    72.00
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q   252.02     196.23    72.00
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q   333.23     196.23    72.00
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R  -1414.46     196.23    72.00
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R   -291.44     196.23    72.00
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R    341.99     196.23    72.00
##                                             t value Pr(>|t|)    
## (Intercept)                                  14.966 1.14e-13 ***
## poly(Olaparib, 3)1                           -4.435 3.24e-05 ***
## poly(Olaparib, 3)2                           -2.982 0.003901 ** 
## poly(Olaparib, 3)3                           -1.832 0.071086 .  
## genotypeALC1KO                               -4.566 0.000125 ***
## genotypeALC1KO+ALC1WT                        -4.066 0.000446 ***
## genotypeALC1KO+ALC1G750E                     -3.058 0.005403 ** 
## genotypeALC1KO+ALC1E175Q                     -7.188 1.99e-07 ***
## genotypeALC1KO+ALC1K77R                      -5.757 6.20e-06 ***
## poly(Olaparib, 3)1:genotypeALC1KO           -10.273 9.35e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO            -0.628 0.532087    
## poly(Olaparib, 3)3:genotypeALC1KO             2.142 0.035595 *  
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1WT     -4.289 5.48e-05 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1WT     -2.432 0.017500 *  
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1WT     -0.371 0.711374    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1G750E -10.697  < 2e-16 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1G750E  -3.355 0.001269 ** 
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1G750E   0.567 0.572396    
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1E175Q  -5.884 1.17e-07 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1E175Q   1.284 0.203160    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1E175Q   1.698 0.093796 .  
## poly(Olaparib, 3)1:genotypeALC1KO+ALC1K77R   -7.208 4.56e-10 ***
## poly(Olaparib, 3)2:genotypeALC1KO+ALC1K77R   -1.485 0.141863    
## poly(Olaparib, 3)3:genotypeALC1KO+ALC1K77R    1.743 0.085638 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("AIC: ", AIC(fit12))
## AIC:  1151.797
simres <- simulateResiduals(fittedModel = fit12)
plot(simres)

Compare Results

ICtab(fit1,fit2,fit3,fit4,
      fit5,fit6,fit7,fit8,
      fit9,fit10,fit11,fit12,
      base=T)
##       AIC    dAIC   df
## fit11 -275.4    0.0 25
## fit7  -267.2    8.2 19
## fit10 -171.6  103.9 25
## fit6  -166.1  109.4 19
## fit3  -152.3  123.1 13
## fit2   -55.4  220.0 13
## fit12 1151.8 1427.2 26
## fit8  1221.9 1497.3 20
## fit4  1398.8 1674.2 14
## fit5  1461.2 1736.6 23
## fit9  1468.0 1743.5 29
## fit1  1499.8 1775.2 17

Final Result

fit <- fit11

output <- coef(summary(fit))
output <- output[grep("Olaparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Olaparib1 in WT -0.7615607 0.1707689 -4.4595983 0.0000223
Olaparib2 in WT -0.5133272 0.1707689 -3.0059757 0.0033782
Olaparib3 in WT -0.3090577 0.1707689 -1.8098008 0.0734558
Olaparib1: WT vs. ALC1KO -2.8984400 0.2415037 -12.0016380 0.0000000
Olaparib2: WT vs. ALC1KO -0.2500492 0.2415037 -1.0353846 0.3030904
Olaparib3: WT vs. ALC1KO 0.5566813 0.2415037 2.3050634 0.0233168
Olaparib1: WT vs. ALC1KO+ALC1WT -1.8537807 0.2415037 -7.6759928 0.0000000
Olaparib2: WT vs. ALC1KO+ALC1WT -1.0192558 0.2415037 -4.2204563 0.0000553
Olaparib3: WT vs. ALC1KO+ALC1WT -0.1715527 0.2415037 -0.7103521 0.4792079
Olaparib1: WT vs. ALC1KO+ALC1G750E -2.6159699 0.2415037 -10.8320074 0.0000000
Olaparib2: WT vs. ALC1KO+ALC1G750E -0.7284510 0.2415037 -3.0163141 0.0032748
Olaparib3: WT vs. ALC1KO+ALC1G750E 0.1483334 0.2415037 0.6142076 0.5405310
Olaparib1: WT vs. ALC1KO+ALC1E175Q -3.0913962 0.2415037 -12.8006161 0.0000000
Olaparib2: WT vs. ALC1KO+ALC1E175Q 0.1651223 0.2415037 0.6837258 0.4957953
Olaparib3: WT vs. ALC1KO+ALC1E175Q 0.5036484 0.2415037 2.0854687 0.0396798
Olaparib1: WT vs. ALC1KO+ALC1K77R -2.9789849 0.2415037 -12.3351520 0.0000000
Olaparib2: WT vs. ALC1KO+ALC1K77R -0.6554356 0.2415037 -2.7139772 0.0078818
Olaparib3: WT vs. ALC1KO+ALC1K77R 0.5598070 0.2415037 2.3180059 0.0225722
write.table(output, file = "Figure1E_Stats_Ref_WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1KO reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO")
        
fit <- lm(NormCounts2 ~ poly(Olaparib, 3)*genotype, data = dataset)


output <- coef(summary(fit))
output <- output[grep("Olaparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Olaparib1 in ALC1KO -3.6600008 0.1707689 -21.4324775 0.0000000
Olaparib2 in ALC1KO -0.7633764 0.1707689 -4.4702307 0.0000214
Olaparib3 in ALC1KO 0.2476236 0.1707689 1.4500511 0.1503036
Olaparib1: ALC1KO vs. WT 2.8984400 0.2415037 12.0016380 0.0000000
Olaparib2: ALC1KO vs. WT 0.2500492 0.2415037 1.0353846 0.3030904
Olaparib3: ALC1KO vs. WT -0.5566813 0.2415037 -2.3050634 0.0233168
Olaparib1: ALC1KO vs. ALC1KO+ALC1WT 1.0446593 0.2415037 4.3256452 0.0000372
Olaparib2: ALC1KO vs. ALC1KO+ALC1WT -0.7692066 0.2415037 -3.1850717 0.0019521
Olaparib3: ALC1KO vs. ALC1KO+ALC1WT -0.7282340 0.2415037 -3.0154155 0.0032837
Olaparib1: ALC1KO vs. ALC1KO+ALC1G750E 0.2824701 0.2415037 1.1696306 0.2450454
Olaparib2: ALC1KO vs. ALC1KO+ALC1G750E -0.4784018 0.2415037 -1.9809295 0.0504605
Olaparib3: ALC1KO vs. ALC1KO+ALC1G750E -0.4083479 0.2415037 -1.6908558 0.0941087
Olaparib1: ALC1KO vs. ALC1KO+ALC1E175Q -0.1929562 0.2415037 -0.7989781 0.4262754
Olaparib2: ALC1KO vs. ALC1KO+ALC1E175Q 0.4151715 0.2415037 1.7191104 0.0888172
Olaparib3: ALC1KO vs. ALC1KO+ALC1E175Q -0.0530329 0.2415037 -0.2195947 0.8266531
Olaparib1: ALC1KO vs. ALC1KO+ALC1K77R -0.0805449 0.2415037 -0.3335140 0.7394737
Olaparib2: ALC1KO vs. ALC1KO+ALC1K77R -0.4053863 0.2415037 -1.6785926 0.0964839
Olaparib3: ALC1KO vs. ALC1KO+ALC1K77R 0.0031257 0.2415037 0.0129425 0.9897005
write.table(output, file = "Figure1E_Stats_Ref_ALC1KO.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1 KO + ALC1 WT reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO+ALC1WT")
        
fit <- lm(NormCounts2 ~ poly(Olaparib, 3)*genotype, data = dataset)


output <- coef(summary(fit))
output <- output[grep("Olaparib", rownames(output)),]

rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype",  paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1],  sep = " in " )

# suggested result table
kable(output, row.names = T)
Estimate Std. Error t value Pr(>|t|)
Olaparib1 in ALC1KO+ALC1WT -2.6153414 0.1707689 -15.3150914 0.0000000
Olaparib2 in ALC1KO+ALC1WT -1.5325830 0.1707689 -8.9746023 0.0000000
Olaparib3 in ALC1KO+ALC1WT -0.4806104 0.1707689 -2.8143903 0.0059292
Olaparib1: ALC1KO+ALC1WT vs. ALC1KO -1.0446593 0.2415037 -4.3256452 0.0000372
Olaparib2: ALC1KO+ALC1WT vs. ALC1KO 0.7692066 0.2415037 3.1850717 0.0019521
Olaparib3: ALC1KO+ALC1WT vs. ALC1KO 0.7282340 0.2415037 3.0154155 0.0032837
Olaparib1: ALC1KO+ALC1WT vs. WT 1.8537807 0.2415037 7.6759928 0.0000000
Olaparib2: ALC1KO+ALC1WT vs. WT 1.0192558 0.2415037 4.2204563 0.0000553
Olaparib3: ALC1KO+ALC1WT vs. WT 0.1715527 0.2415037 0.7103521 0.4792079
Olaparib1: ALC1KO+ALC1WT vs. ALC1KO+ALC1G750E -0.7621892 0.2415037 -3.1560146 0.0021369
Olaparib2: ALC1KO+ALC1WT vs. ALC1KO+ALC1G750E 0.2908048 0.2415037 1.2041422 0.2314952
Olaparib3: ALC1KO+ALC1WT vs. ALC1KO+ALC1G750E 0.3198861 0.2415037 1.3245597 0.1884618
Olaparib1: ALC1KO+ALC1WT vs. ALC1KO+ALC1E175Q -1.2376155 0.2415037 -5.1246233 0.0000015
Olaparib2: ALC1KO+ALC1WT vs. ALC1KO+ALC1E175Q 1.1843782 0.2415037 4.9041822 0.0000038
Olaparib3: ALC1KO+ALC1WT vs. ALC1KO+ALC1E175Q 0.6752011 0.2415037 2.7958207 0.0062531
Olaparib1: ALC1KO+ALC1WT vs. ALC1KO+ALC1K77R -1.1252042 0.2415037 -4.6591592 0.0000102
Olaparib2: ALC1KO+ALC1WT vs. ALC1KO+ALC1K77R 0.3638203 0.2415037 1.5064791 0.1352278
Olaparib3: ALC1KO+ALC1WT vs. ALC1KO+ALC1K77R 0.7313597 0.2415037 3.0283580 0.0031581
write.table(output, file = "Figure1E_Stats_Ref_ALC1KO+ALC1WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)

Anova

fita <- lm(NormCounts2 ~ poly(Olaparib, 3)*genotype, data = dataset)
fitb <- lm(NormCounts2 ~ poly(Olaparib, 3)+genotype, data = dataset)

# anova table
anova(fita, fitb)
## Analysis of Variance Table
## 
## Model 1: NormCounts2 ~ poly(Olaparib, 3) * genotype
## Model 2: NormCounts2 ~ poly(Olaparib, 3) + genotype
##   Res.Df     RSS  Df Sum of Sq      F    Pr(>F)    
## 1     96 0.46659                                   
## 2    111 1.89545 -15   -1.4289 19.599 < 2.2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1